#include "../include/wake.h"
#include <ESP32Ping.h>
#include <HTTPClient.h>
const char *ssid = "Redmi_0C9F";
const char *password = "13780874882";
uint8_t macAddress[] = {0x00, 0xE2, 0x69, 0x8A, 0xCE, 0x42};

uint64_t previousMillis, currentMillis;
uint64_t timeoutInterval = 1 * 60 * 1000;
void setup() {
    Serial.begin(115200);
    previousMillis = currentMillis = millis();
}

void loop() {
    if (WiFi.status() != WL_CONNECTED) {
        currentMillis = millis();
        if (currentMillis - previousMillis >= timeoutInterval) {
        }
        WiFi.begin(ssid, password);
    }
    previousMillis = currentMillis = millis();
    HTTPClient http;
    http.begin("http://47.93.166.33:8000/gettgt");
    int httpCode = http.GET();
    if (Ping.ping("192.168.31.1"))
        sendWOL();
    delay(1000);
}
